<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ include file="securty.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>美图随心看</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 
<script type="text/javascript" >
function a(){
  window.opener = null;
   window.close();
}
if(!isLogin)  { a() ;}
</script>

</head>

<body> 

<div> 
	<table width="" cellpadding="0" cellspacing="0" border="0" align="center">
		<tr>
			<td><h1>后台配置</h1></td>
		</tr>
	</table>
</div>
<hr />
<div> 
	<table width="" cellpadding="8" cellspacing="0" border="0" align="center">
		<tr>
			<td align="right"> 首页每次展示图片数量</td> <td> <input name="psize" id="psize" value="${psize }" />  </td>
		</tr>
		<tr>	
			<td align="right"> 每次抓取几页</td> <td> <input name="csize" id="csize"  value="${csize }" />  </td>
		</tr>
		<tr>	
			<td align="right"> 自动抓啊</td> <td> <input name="autocatch" id="autocatch"  value="${autocatch}" /> <i style="color:#eee"><b>true</b>是自动抓取</i> </td>
		</tr>
		<tr>	
			<td align="right"> 管理员密码</td> <td> <input name="pswd" id="pswd"  value="${pswd }" />  </td>
		</tr>
		<tr>	
			<td align="right"> 网站列表</td> <td><textarea  name="website" id="website" rows='20' cols='100' >${website }</textarea> </td>
		</tr>
		<tr>	
			<td colspan="2" align="center">  <button style='padding:6px 36px' id="s">  提交</button> </td>
		</tr>
	</table>
</div>
<div> 
<!-- <a href="/">看图</a> -->
<a href="javascript:void(0)" onclick="a()" >关闭</a>
</div>

		<!--[if lt IE 9]>
		<script src="${ctx}/js/jquery-1.11.1.min.js"></script>
		<![endif]-->
		<!--[if gte IE 9]><!-->
		<script src="${ctx}/js/jquery-2.0.3.min.js"></script>
		<!--<![endif]-->

<script type='text/javascript'>
$(document).ready(function() { 
	$("#s").click(function(){
		var p=$("#psize").val();
		var c=$("#csize").val();
		var pswd=$("#pswd").val();
		var website=$("#website").val();
		var autocatch=$("#autocatch").val();
		if( $.trim(p) == "" ) { $("#psize").select().focus();  alert("p不能为空");return ;}
		if( $.trim(c) == "" ) { $("#csize").select().focus();  alert("c不能为空");return ;}
		if( $.trim(pswd) == "" ) { $("#pswd").select().focus();  alert("pswd不能为空");return ;}
		if( $.trim(autocatch) == "" ) { $("#autocatch").select().focus();  alert("autocatch不能为空");return ;}
		$.post("${ctx}/config/update",{p:p,c:c,pswd:pswd,website:website,autocatch:autocatch},function(dt){
			if(!dt)  { window.location.href="${ctx}"; }
			if(dt.retcode!=0){ alert(dt.retmsg); return ;}
			alert("修改成功");
			a();
			//window.location.reload();
		});
	});
});
</script>
</body>
</html>
